<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>客户信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!-- easyui -->
<link rel="stylesheet" type="text/css" href="/_resources/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="/_resources/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="/_resources/easyui/themes/extIcon.css">
<link rel="stylesheet" type="text/css" href="/_resources/easyui/demo/demo.css">
<script type="text/javascript" src="/_resources/easyui/jquery.min.js"></script>
<script type="text/javascript" src="/_resources/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="/_resources/easyui/jquery.edatagrid.js"></script>
<script type="text/javascript" src="/_resources/js/jqueryUtils.js"></script>
<script type="text/javascript" src="/_resources/js/date.js"></script>
<script type="text/javascript" src="/_resources/My97DatePicker/WdatePicker.js"></script>
<script language='javascript'>
	function jsSave() {
		var params =  $.serializeObject($('#form1'));
		
		if(params.name == ''){
			$.messager.alert('提醒信息','客户名称不能为空');
			return;
		}
		
		$.ajax({
		  type: 'POST',
		  url: "save.do" ,
		  data: params,
		  dataType: "json",
		  error:function(){
		  	$('#form1').find("input[name=savingFlag]").val('');
		  	alert('系统异常'); 
		  },
		  success: function(json){
		  	$('#form1').find("input[name=savingFlag]").val('');
		  	if(json.errorCode == 200){
		  		$('#id').val(json.data.id);
		  		
		  		$.messager.show({title: '提醒信息', msg: '保存成功'});
		  	}else{
		  		$.messager.show({title: '提醒信息', msg: '保存失败-' + json.moreInfo});
		  	}
		  }
		});
	}
</script>
</head>
<body style='margin-top:10px;margin-bottom:20px'>

<div align="left">
<div class="title" style="width:800px;font-size:14px;text-align: center;"><strong>客户信息</strong></div>

<form method="post" name="form1" id="form1">
<table>
	<tr>
		<td style="width:80px"></td>
		<td style="width:560px"></td>
	</tr>
	<tr>
		<td colspan='4' style='text-align:center'>
			<a href='javascript:void(0)' onclick='jsSave();' class="easyui-linkbutton" data-options="iconCls:'icon-save'">保存</a>
			<input type='hidden' id='id' name='id' value="${customer.id}" />
			<input type='hidden' id='savingFlag' name='savingFlag'/> <!-- 是否正在保存 -->
		</td>
	</tr>
	<tr> 
		<td style="text-align:right">*客户名称</td>
		<td >
			<input type='text' name='name' style="width:330px;" value='${customer.name}' />
		</td>  
	</tr>
	<tr>	
		<td style="text-align:right">Email</td>
		<td>
			<input type='text' name="email" value="${customer.email}" />
		</td>
	</tr>
	<tr>	
		<td style="text-align:right">联系人</td>
		<td>
			<input type='text' name="lxr" value="${customer.lxr}" />
		</td>
	</tr>
	<tr>	
		<td style="text-align:right">公司网址</td>
		<td>
			<input type='text' name="website" value="${customer.website}" />
		</td>
	</tr>
	<tr>	
		<td style="text-align:right">公司电话</td>
		<td>
			<input type='text' name="phone" value="${customer.phone}" />
		</td>
	</tr>
	<tr>	
		<td style="text-align:right">公司传真</td>
		<td>
			<input type='text' name="fax" value="${customer.fax}" />
		</td>
	</tr>
	<tr>	
		<td style="text-align:right">公司地址</td>
		<td>
			<input type='text' name="addr" value="${customer.addr}" />
		</td>
	</tr>
	<tr>	
		<td style="text-align:right">所在国家</td>
		<td>
			<input type='text' name="country" value="${customer.country}" />
		</td>
	</tr>
</table>
</form>
</div>
<style type="text/css">
*{margin:0px; padding:0px;}
.dn{display:none;}
.chackTextarea-area{line-height:22px; font-size:14px; padding:1px 5px; border:1px solid #CDCDCD; width:630px; height:40px;}
.content{width:420px; margin:0 auto; padding-top:20px;}
.content h1{font-size:16px; font-family:微软雅黑; font-weight:normal;}
</style>

</body>
</html>
